//
//  SuitCell.m
//  BeautyClother
//
//  Created by dllo on 15/8/24.
//  Copyright (c) 2015年 宋爽. All rights reserved.
//

#import "SuitCell.h"

@interface SuitCell ()

@property (nonatomic, assign) CGFloat offWidth;
@property (nonatomic, assign) CGFloat offHeight;

@end

@implementation SuitCell

- (void)dealloc
{
    [_title release];
    [_image release];
    [super dealloc];
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.image = [[UIImageView alloc]init];
        [self.contentView addSubview:_image];
    
        [_image release];
        
        
        _title = [[UILabel alloc]init];
        [self.contentView addSubview:_title];
        [_title release];
        
        self.share = [UIButton buttonWithType:UIButtonTypeSystem];
        [self.contentView addSubview:_share];
        
        self.like = [[UIButton alloc]init];
        [self.contentView addSubview:_like];
        
        self.line = [[UILabel alloc]init];
        [self.contentView addSubview:_line];
        [_line release];
        self.offWidth = [[UIScreen mainScreen]bounds].size.width / 375;
        self.offHeight = [[UIScreen mainScreen]bounds].size.height / 667;
        
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    self.image.frame = CGRectMake(0, 0, self.contentView.frame.size.width, self.contentView.frame.size.height - 50*_offHeight);
    self.title.frame = CGRectMake(10 *_offWidth, self.contentView.frame.size.height - 45*_offHeight, self.contentView.frame.size.width - 20*_offWidth, 20*_offHeight);

    _line.frame = CGRectMake(10*_offWidth, self.contentView.frame.size.height - 23*_offHeight, self.frame.size.width - 20*_offWidth, 0.2);
    [self addSubview:_line];
    _line.backgroundColor = [UIColor lightGrayColor];


    
    self.share.frame = CGRectMake(10*_offWidth, self.contentView.frame.size.height - 20*_offHeight, 70*_offWidth, 20*_offHeight);
    self.like.frame = CGRectMake(80*_offWidth, self.contentView.frame.size.height - 20*_offHeight, 70*_offWidth, 20  *_offHeight  );
    [self.share setImage:[UIImage imageNamed:@"lianjie.png"] forState:UIControlStateNormal];
    [self.share setTintColor:[UIColor darkGrayColor]];
    [self.share setTitleColor:[UIColor darkGrayColor] forState:UIControlStateNormal];
    self.share.titleLabel.font = [UIFont systemFontOfSize:12];
    
//    [self.like setImage:[UIImage imageNamed:@"heart.png"] forState:UIControlStateNormal];
//    [self.like setTintColor:[UIColor darkGrayColor]];
    [self.like setTitleColor:[UIColor darkGrayColor] forState:UIControlStateNormal];
    self.like.titleLabel.font = [UIFont systemFontOfSize:12];
}

@end
